package com.sh.d1.gatewayserver.router;

import com.sh.d1.gameserver.async.AsyncOperationProcessor;
import com.sh.d1.gatewayserver.GameServerFinder;
import com.sh.d1.gatewayserver.NettyClient;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;

class LoginMsgHandler {


    public void sendMsg(ChannelHandlerContext ctx, BinaryWebSocketFrame outputFrame) {
        if(null==ctx || null==outputFrame){
            return;
        }
        AsyncOperationProcessor.getInstance().process(()->{
            NettyClient nettyClient = GameServerFinder.selectOnGameServer(GameServerFinder.JOB_TYEP_LOGIN);
            if (null != nettyClient) {
                nettyClient.sendMsg(outputFrame);
            }
        });
    }
}
